function Star(options) {
    this.x = options.x,
        this.y = options.y,
        this.size = 5,
        this.opacity = 1,
        this.ctx = options.ctx,
        this.num = options.num||0

}
Star.prototype.render = function () {

    var px = this.x;
    var py = this.y;
    this.ctx.beginPath();
    this.ctx.fillStyle = "rgba(170,41,143,1)"

    this.ctx.arc(px, py, 10, 0, 2 * Math.PI);
    this.ctx.fill();



    this.ctx.strokeStyle = "rgba(170,41,143," + (this.opacity - 0.1) + ")";
    this.ctx.lineWidth = 5;
    this.ctx.beginPath();
    this.ctx.arc(px, py, this.size / 10, 0, 2 * Math.PI);
    this.ctx.stroke();

    this.ctx.strokeStyle = "rgba(170,41,143," + (this.opacity - 0.2) + ")";
    this.ctx.lineWidth = 3;
    this.ctx.beginPath();
    this.ctx.arc(px, py, this.size / 5, 0, 2 * Math.PI);
    this.ctx.stroke();

    this.ctx.strokeStyle = "rgba(170,41,143," + (this.opacity - 0.3) + ")";
    this.ctx.lineWidth = 2;
    this.ctx.beginPath();
    this.ctx.arc(px, py, this.size / 2, 0, 2 * Math.PI);
    this.ctx.stroke();

    this.size=(this.size+10)%100
    this.opacity=this.opacity-0.1;
    if(this.opacity<0.1) this.opacity=1;


    this.ctx.font="";
    this.ctx.strokeStyle="#fff";
    this.ctx.strokeText(this.num,px-3,py+4);
};

function doRender(canvas,st){
    var ctx = canvas.getContext("2d");
    ctx.clearRect(0,0,canvas.width,canvas.height);
    st.render();
    setTimeout(function(){doRender(canvas,st)},100);
}